<!--
 * @Description: 用户协议 modal
 * @Author: lipenghui
 * @Date: 2023-07-24 21:04:32
 * @LastEditors: lipenghui
 * @LastEditTime: 2023-07-31 10:31:01
-->
<template>
  <u-modal
    v-model="show"
    title="欢迎使用 青鸟翼联工业互联网平台"
    :show-cancel-button="true"
    confirm-text="同意并继续"
    cancel-text="不同意并退出"
    confirm-color="#000000"
    :title-style="{ color: '#000000', fontWeight: 'bold' }"
    @confirm="confirmModal"
    @cancel="cancelModal"
  >
    <view class="slot-content">
      为了更好的保护您的权利,
      同时遵守相关监管要求如果点击同意并继续则代表您已阅读并同意
      <navigator
        class="link"
        hover-class="none"
        url="/packages/pages/agreement/agreement?type=user"
      >
        《青鸟翼联用户协议》
      </navigator>
    </view>
  </u-modal>
</template>

<script lang="ts" setup>
import { computed } from "vue";
const props = withDefaults(
  defineProps<{
    modalShow: boolean;
  }>(),
  {
    modalShow: false,
  }
);
const emit = defineEmits(["update:modalShow", "change:confirmModal"]);

const show = computed({
  get() {
    return props.modalShow;
  },
  set(val) {
    emit("update:modalShow", val);
  },
});

const confirmModal = () => {
  emit("update:modalShow", false);
  emit("change:confirmModal");
};
const cancelModal = () => {
  emit("update:modalShow", false);
};

const goPath = (path: string) => {
  uni.navigateTo({
    url: path,
  });
};
</script>

<style lang="scss" scoped>
.link {
  color: $u-type-primary;
  display: inline;
}
.slot-content {
  padding: 30rpx;
  line-height: 50rpx;
  font-size: 28rpx;
}
</style>
